<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
if(h<_rate*1206){
   h=_rate*1206;
}
var _mbgFlag=false;
var _mbg=document.getElementById("mbg");
var _bgCanvasStop=false;
document.body.addEventListener('touchmove', function(e) {e.preventDefault();}, { passive: false }); 
$('html,body').css({overflow:'hidden',height:'100%',position:'fixed',left:0,top:0});
$(function(){
  $('.container').width(sWidth).height(h);
  $('.home-btn').width(_rate*372).css({"bottom":_rate*90, "left":_rate*188});
  $('.home-t1').css({"top":_rate*468});  
  $('.canvas-bg, .canvas-user').width(sWidth).height(h);
  $('.mus-box').width(_rate*60).css({"top":_rate*15, "right":_rate*15});
  
  $(".p1-r1").width(_rate*338).height(_rate*377).css({"bottom":-_rate*68, "left":_rate*90});
  $(".p1-y1").width(_rate*80).css({"top":_rate*86, "left":_rate*192});
  $(".p1-y2").width(_rate*69).css({"top":_rate*38, "left":_rate*96});
  $(".p1-r2").width(_rate*270).height(_rate*435).css({"bottom":-_rate*48, "left":_rate*352});
  $(".p1-r3").width(_rate*303).css({"bottom":-_rate*188, "left":_rate*346});
  $('.p1-t1').css({"top":_rate*148}); 
  $('.p1-t2').css({"top":_rate*364}); 
  $(".p1-ta").width(_rate*370).css({"top":_rate*546, "left":_rate*56});
  $(".p1-tb").width(_rate*370).css({"top":_rate*724, "left":_rate*56});
  $('.p2-t1').css({"top":_rate*274}); 
  $('.p2-t2').css({"top":_rate*460});
  $(".p2-ta").width(_rate*234).css({"top":_rate*610, "left":_rate*76});
  $(".p2-tb").width(_rate*234).css({"top":_rate*736, "left":_rate*420});

  $(".p2-r1").width(_rate*394).height(_rate*351).css({"bottom":-_rate*112, "left":_rate*70});
  $(".p2-y1").width(_rate*79).css({"top":_rate*30, "left":_rate*86});

  $(".p2-r2").width(_rate*529).height(_rate*533).css({"bottom":-_rate*226, "left":_rate*184});
  $(".p2-y2").width(_rate*62).css({"top":_rate*64, "left":_rate*224});

  $('.p3-t1').css({"top":_rate*94}); 
  $('.p3-t2').css({"top":_rate*244});
  $(".p3-ta, .p3-tb, .p3-tc").width(_rate*242);
  $(".p3-ta").css({"top":_rate*344, "left":_rate*252});
  $(".p3-tb").css({"top":_rate*680, "left":_rate*252});
  $(".p3-tc").css({"top":_rate*1020, "left":_rate*252});

  $('.p4-t1').css({"top":_rate*254}); 
  $('.p4-t2').css({"top":_rate*400});
  $(".p4-ta, .p4-tb").width(_rate*462);
  $(".p4-ta").css({"top":_rate*624, "left":_rate*246});
  $(".p4-tb").css({"top":_rate*806, "left":_rate*118});
  
  $(".p4-r1").width(_rate*265).height(_rate*442).css({"bottom":-_rate*108, "left":_rate*136});
  $(".p4-y1").width(_rate*67).css({"top":_rate*42, "left":_rate*104});
  $(".p4-r2").width(_rate*266).height(_rate*413).css({"bottom":-_rate*166, "left":_rate*372});
  $(".p4-y2").width(_rate*65).css({"top":_rate*40, "left":_rate*36});

  
  $('.p5-t1').css({"top":_rate*424}); 
  $('.p5-t2').css({"top":_rate*676});
  $(".p5-ta, .p5-tb").width(_rate*249);
  $(".p5-ta").css({"top":_rate*834, "left":_rate*108});
  $(".p5-tb").css({"top":_rate*834, "left":_rate*394});

  $('.p6-t1').css({"top":_rate*226}); 
  $('.p6-t2').css({"top":_rate*414});

  $(".p6-ta, .p6-tb").width(_rate*513);
  $(".p6-ta").css({"top":_rate*642, "left":_rate*142});
  $(".p6-tb").css({"top":_rate*782, "left":_rate*236});

  $(".p6-r1").width(_rate*309).height(_rate*537).css({"bottom":-_rate*178, "left":_rate*136});
  $(".p6-y1").width(_rate*67).css({"top":_rate*122, "left":_rate*106});

  $(".p6-r2").width(_rate*325).css({"bottom":-_rate*426, "left":_rate*336});

  $('.p7-t1').css({"top":_rate*258}); 
  $('.p7-t2').css({"top":_rate*448});

  $(".p7-ta").width(_rate*351).css({"top":_rate*636, "left":_rate*276});
  $(".p7-tb").width(_rate*461).css({"top":_rate*830, "left":_rate*114});
  $(".p7-r1").width(_rate*324).height(_rate*540).css({"bottom":-_rate*228, "left":_rate*66});
  $(".p7-y1").width(_rate*68).css({"top":_rate*94, "left":_rate*166});

  $(".p7-r2").width(_rate*389).css({"bottom":-_rate*232, "left":_rate*246});

  $('.p8-t1').css({"top":_rate*222}); 
  $('.p8-t2').css({"top":_rate*448});
  
  $(".p8-ta").width(_rate*364).css({"top":_rate*700, "left":_rate*290});
  $(".p8-tb").width(_rate*271).css({"top":_rate*844, "left":_rate*382});

  $(".p8-r1").width(_rate*303).css({"bottom":-_rate*162, "left":_rate*128});

  $(".p8-r2").width(_rate*324).height(_rate*370).css({"bottom":-_rate*76, "left":_rate*348});
  $(".p8-y1").width(_rate*65).css({"top":_rate*88, "left":_rate*72});

  $('.p9-t1').css({"top":_rate*222}); 
  $('.p9-t2').css({"top":_rate*380});

  $(".p9-ta").width(_rate*241).css({"top":_rate*606, "left":_rate*102});
  $(".p9-tb").width(_rate*314).css({"top":_rate*740, "left":_rate*364});

  $(".p9-r1").width(_rate*386).height(_rate*353).css({"bottom":-_rate*116, "left":_rate*80});
  $(".p9-y1").width(_rate*61).css({"top":_rate*38, "left":_rate*114});

  $(".p9-r2").width(_rate*546).height(_rate*548).css({"bottom":-_rate*234, "left":_rate*178});
  $(".p9-y2").width(_rate*62).css({"top":_rate*90, "left":_rate*232});
  
  $('.user-t1').css({"top":_rate*478});
  $(".user-input").width(_rate*437).height(_rate*82).css({"top":_rate*612, "left":_rate*156});
  $("#user-name").css({"line-height":_rate*82+'px'});
  $(".user-btn").width(_rate*496).css({"top":_rate*718, "left":_rate*134});
  $('.jie-t1').css({"bottom":_rate*147});
  $('.jie-name').height(_rate*80).css({"top":_rate*998});
  $('.jie-btn').css({"top":_rate*30});
 
  $('.jie-bottom').height(_rate*162);
  
  
 

  var _cha='';
  if(h < _rate*1400){
    _cha=h - _rate*1400;
    $('.thebg').css({"top":_cha/2});
  }
  
  if(h < _rate*1421){
      $('.jie-t1').css({"bottom":_rate*117});
  }
  if(h < _rate*1381){
      $('.jie-t1').css({"bottom":_rate*70});
      $('.jie-last').css({"bottom":-_rate*10});
  }
  if(h < _rate*1345){
      $('.jie-t1').width('98%').css({"bottom":_rate*70, "left": '1%'});
      $('.jie-name').css({"top":_rate*974});
  }
  if(h < _rate*1301){
    _cha=h - _rate*1400;
    $('.thebg').css({"top":_cha/2});
    $('.p3-t1').css({"top":_rate*104}); 
    $('.p3-t2').css({"top":_rate*254});
    $(".p3-ta, .p3-tb, .p3-tc").width(_rate*200);
    $(".p3-ta").css({"top":_rate*344, "left":_rate*275});
    $(".p3-tb").css({"top":_rate*660, "left":_rate*275});
    $(".p3-tc").css({"top":_rate*1000, "left":_rate*275});

    $('.jie-t1').width('92%').css({"bottom":_rate*50, "left": '4%'});
    $('.jie-name').css({"top":_rate*910});
  }
  if(h < _rate*1251){
    $('.thebg').css({"top":_cha/2});
    $('.p3-t1').css({"top":_rate*114}); 
    $('.p3-t2').css({"top":_rate*264});
    $(".p3-ta").css({"top":_rate*344});
    $(".p3-tb").css({"top":_rate*640});
    $(".p3-tc").css({"top":_rate*940});
    $(".p7-ta").css({"top":_rate*606});
    $(".p7-tb").css({"top":_rate*800});

    $('.jie-t1').width('90%').css({"bottom":_rate*20, "left": '5%'});
    $('.jie-name').css({"top":_rate*884});
     
  }

  if(h < _rate*1220){
      $('.jie-t1').width('86%').css({"bottom":_rate*10, "left": '7%'});
      $('.jie-name').css({"top":_rate*842});
  }

  wx.config({
        appId: '<?php echo $signPackage["appId"];?>',
        timestamp: <?php echo $signPackage["timestamp"];?>,
        nonceStr: '<?php echo $signPackage["nonceStr"];?>',
        signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData', 'showMenuItems', 'hideMenuItems']
    });
  var _link='http://wakeupin-whr.mei94.com/';
  var _imgUrl='http://wakeupin-whr.mei94.com/img/64.jpg';
    wx.ready(function () {
      wx.updateAppMessageShareData({
          title: '2022年，探寻你的灵魂漫游目的地', 
          desc: '', 
          link: _link, 
          imgUrl: _imgUrl,success: function () {}
        });
       wx.updateTimelineShareData({
              title: '2022年，探寻你的灵魂漫游目的地', 
              link: _link, 
              imgUrl: _imgUrl, success: function () {}});

          

    });

    document.addEventListener("WeixinJSBridgeReady", function () {
          _mbg.play();
          window.setTimeout(function(){
            _mbg.play();
          }, 400);
        }, false);

    _mbg.play();
    window.setTimeout(function(){
    	if(false == _mbg.paused){
            $(".mus").addClass("gorotate").attr("src","./img/m.png");
            _mbgFlag=true;
        }
    }, 800);
  var _userTM=[];
  var _userJ={};
    _userJ[1]=0;
    _userJ[2]=0;
    _userJ[3]=0;
    _userJ[4]=0;
    _userJ[5]=0;
    _userJ[6]=0;
    _userJ[7]=0;
    _userJ[8]=0;
    _userJ[9]=0;
  var _userY={};
  _userY[0]=0;
  _userY[3]=9;
  _userY[4]=8;
  _userY[8]=7;
  _userY[9]=6;
  _userY[6]=5;
  _userY[7]=4;
  _userY[2]=3;
  _userY[1]=2;
  _userY[5]=1;
console.log(_userJ);
 
  $('.home-btn').click(function(){
    _bgCanvasStop=true;
    $(".home").fadeOut();
    $(".p1").fadeIn();
     window.setTimeout(function(){
        $(".home").hide();
      }, 500);
      window.setTimeout(function(){
        $(".p1-ta").removeClass("fadeInLeft  animated d6s");
        $(".p1-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
       
  });
  function _setClickP1(){
    window.setTimeout(function(){
        $(".p1").fadeOut('slow');
        $(".p2").fadeIn('slow');
      }, 500);
      window.setTimeout(function(){
        $(".p2-ta").removeClass("fadeInLeft  animated d6s");
        $(".p2-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
  }
  function _clickLog(_name,_id){
      $.post("./api/?c=user", {name:_name, id:_id, uid:'<?php echo $uid; ?>'}, function(data){}, "json");
      _userTM.push(_name);
  }
  $(".p1-ta").click(function(){
      _userJ[5]=_userJ[5]+1;
      console.log(_userJ);
      _clickLog('p1-a',5);
  	  $(".p1-ta").addClass("ani6 swing2");
  	  _setClickP1();
  	  
  });
  $(".p1-tb").click(function(){
      _userJ[7]=_userJ[7]+1;
      _clickLog('p1-b',7);
      console.log(_userJ);
  	  $(".p1-tb").addClass("ani6 swing2");
  	  _setClickP1();
  });
  function _showp3(){
     move('.p3-ta').ease('out').x(0).duration('.8s').delay('.2s').rotate(360).end();
     setTimeout(function(){
         move('.p3-tb').ease('out').x(0).duration('.8s').delay('.2s').rotate(-360).end();
     }, 10);
      setTimeout(function(){
         move('.p3-tc').ease('out').x(0).duration('.8s').delay('.2s').rotate(360).end();
     }, 10);
  }
  $(".p2-ta").click(function(){
      $(".p2-ta").addClass("ani6 swing2");
      _userJ[3]=_userJ[3]+1;
      _clickLog('p2-a',3);
      console.log(_userJ);
      window.setTimeout(function(){
        $(".p2").fadeOut('slow');
        $(".p3").fadeIn('slow');
      }, 500);
      
  });
  $(".p2-tb").click(function(){
      $(".p2-tb").addClass("ani6 swing2");
      _userJ[4]=_userJ[4]+1;
      _clickLog('p2-b',4);
      console.log(_userJ);
      window.setTimeout(function(){
        $(".p2").fadeOut('slow');
        $(".p3").fadeIn('slow');
      }, 500);
  });
  function _setClickP3(){
      window.setTimeout(function(){
        $(".p3").fadeOut('slow');
        $(".p4").fadeIn('slow');
      }, 500);
      window.setTimeout(function(){
        $(".p4-ta").removeClass("fadeInLeft animated d6s");
        $(".p4-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
  }
  var _maxId=0;
  function getMax(){
    var _tmpMax=0;
    for(var i=1;i<=9;i++){
        if(_userJ[i] > _tmpMax){
          _tmpMax=_userJ[i];
          _maxId=i;
        }
        if(_userJ[i] == _tmpMax){
            if(_userY[i] > _userY[_maxId]){
                _maxId=i;
            }
        }
        console.log(_tmpMax);
    }
    $("#jie-b1").attr("src","<?php echo $cdnUrl ?>img/jie/"+_maxId+".jpg");
    $(".jie-tu").attr("src","<?php echo $cdnUrl ?>img/jie/j"+_maxId+".png");
  
    console.log(_maxId);
    return _maxId;
  }
  $(".p3-ta").click(function(){
      $(".p3-ta").addClass("ani6 swing2");
      _userJ[1]=_userJ[1]+1;
      _clickLog('p3-a',1);
      console.log(_userJ);
      _setClickP3();

  });
  $(".p3-tb").click(function(){
      $(".p3-tb").addClass("ani6 swing2");
       _userJ[2]=_userJ[2]+1;
       _clickLog('p3-b',2);
       console.log(_userJ);
      _setClickP3();
  });
  $(".p3-tc").click(function(){
      $(".p3-tc").addClass("ani6 swing2");
       _userJ[9]=_userJ[9]+1;
       _clickLog('p3-c',9);
       console.log(_userJ);
      _setClickP3();
  });

  function _setClickP4(){
       window.setTimeout(function(){
        setTimeout(function(){
           move('.p5-ta').ease('out').x(0).duration('1s').delay('.2s').rotate(360).end();
           move('.p5-tb').ease('out').x(0).duration('1s').delay('.2s').rotate(-360).end();
        }, 10);
        $(".p4").fadeOut('slow');
        $(".p5").fadeIn('slow');
      }, 500);
  }
  $(".p4-ta").click(function(){
      $(".p4-ta").addClass("ani6 swing2");
       _userJ[1]=_userJ[1]+1;
       _clickLog('p4-a',1);
       console.log(_userJ); 
      _setClickP4();
  });
  $(".p4-tb").click(function(){
      $(".p4-tb").addClass("ani6 swing2");
      _userJ[2]=_userJ[2]+1; 
      _clickLog('p4-b',2);
      console.log(_userJ);
      _setClickP4();
  });
  function _setClickP5(){
      window.setTimeout(function(){
        $(".p5").fadeOut('slow');
        $(".p6").fadeIn('slow');
      }, 500);
      window.setTimeout(function(){
        $(".p6-ta").removeClass("fadeInLeft animated d6s");
        $(".p6-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
  }
  $(".p5-ta").click(function(){
      $(".p5-ta").addClass("ani6 swing2");
      _userJ[4]=_userJ[4]+1;
      _clickLog('p5-a',4);
      console.log(_userJ);
      _setClickP5();
  });
  $(".p5-tb").click(function(){
      $(".p5-tb").addClass("ani6 swing2");
      _userJ[5]=_userJ[5]+1;
      _clickLog('p5-b',5);
      console.log(_userJ);
      _setClickP5();
  });
  function _setClickP6(){
      window.setTimeout(function(){
        $(".p6").fadeOut('slow');
        $(".p7").fadeIn('slow');
      }, 500); 
      window.setTimeout(function(){
        $(".p7-ta").removeClass("fadeInLeft animated d6s");
        $(".p7-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
  }
  $(".p6-ta").click(function(){
      $(".p6-ta").addClass("ani6 swing2");
      _userJ[7]=_userJ[7]+1;
      _clickLog('p6-a',7);
      console.log(_userJ);
      _setClickP6();
  });
  $(".p6-tb").click(function(){
      $(".p6-tb").addClass("ani6 swing2");
      _userJ[6]=_userJ[6]+1;
      _clickLog('p6-b',6);
      console.log(_userJ);
      _setClickP6();
  });
  function _setClickP7(){
      window.setTimeout(function(){
        $(".p8-ta").removeClass("fadeInLeft animated d6s");
        $(".p8-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
  }
  $(".p7-ta").click(function(){
      $(".p7-ta").addClass("ani6 swing2");
      _userJ[6]=_userJ[6]+1;
      _clickLog('p7-a',6);
      console.log(_userJ);
      window.setTimeout(function(){
        $(".p7").fadeOut('slow');
        $(".p8").fadeIn('slow');
      }, 500);
      _setClickP7();
  });
  $(".p7-tb").click(function(){
      $(".p7-tb").addClass("ani6 swing2");
      _userJ[3]=_userJ[3]+1;
      _clickLog('p7-b',3);
      console.log(_userJ);
      window.setTimeout(function(){
        $(".p7").fadeOut('slow');
        $(".p8").fadeIn('slow');
      }, 500);
      _setClickP7();
  });
  function _setClickP8(){
      window.setTimeout(function(){
        $(".p9-ta").removeClass("fadeInLeft animated d6s");
        $(".p9-tb").removeClass("fadeInRight animated d6s");
      }, 1800);
  }
  $(".p8-ta").click(function(){
      $(".p8-ta").addClass("ani6 swing2");
      _userJ[8]=_userJ[8]+1;
      _clickLog('p8-a',8);
      console.log(_userJ);
      window.setTimeout(function(){
        $(".p8").fadeOut('slow');
        $(".p9").fadeIn('slow');
      }, 500);
      _setClickP8();
  });
  $(".p8-tb").click(function(){
      $(".p8-tb").addClass("ani6 swing2");
      _userJ[9]=_userJ[9]+1;
      console.log(_userJ);
      _clickLog('p8-b',9);
      window.setTimeout(function(){
        $(".p8").fadeOut('slow');
        $(".p9").fadeIn('slow');
      }, 500);
      _setClickP8();
  });

  $(".p9-ta").click(function(){
      $(".p9-ta").addClass("ani6 swing2");
      _userJ[1]=_userJ[1]+1;
      console.log(_userJ);
      _clickLog('p9-a',1);
      getMax();
      window.setTimeout(function(){
        $(".p9").fadeOut('slow');
        $(".user").fadeIn('slow');
        _bgCanvasStop=false;
        _runBg('canvas-user');
      }, 500);
  });
  $(".p9-tb").click(function(){
      $(".p9-tb").addClass("ani6 swing2");
      _userJ[8]=_userJ[8]+1;
      _clickLog('p9-b',8);
      console.log(_userJ);
      getMax();
      window.setTimeout(function(){
        $(".p9").fadeOut('slow');
        $(".user").fadeIn('slow');
        _bgCanvasStop=false;
        _runBg('canvas-user');
      }, 500);
  });
  


  
function random(min, max) {
if (arguments.length < 2) {
max = min;
min = 0;
}
if (min > max) {
var hold = max;
max = min;
min = hold;
}
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function maxOrbit(x, y) {
  var max = Math.max(x, y),
    diameter = Math.round(Math.sqrt(max * max + max * max));
  return diameter / 2;
  //星星移动范围，值越大范围越小，
}


var image = new Image();
image.src='./img/index.jpg';
image.addEventListener('load', lH1);
function _runBg(_cvasId){
	  var canvas = document.getElementById(_cvasId);
  var ctx = canvas.getContext('2d');
  var w = canvas.width = window.innerWidth;
  var h = canvas.height = window.innerHeight;
  var hue = 217;
  var stars = [];
  var count = 0;
  var maxStars = 260;//星星数量
  var img=document.getElementById("p1-b");

  var canvas2 = document.createElement('canvas'),
    ctx2 = canvas2.getContext('2d');
	canvas2.width = 100;
	canvas2.height = 100;
	var half = canvas2.width / 2,
	gradient2 = ctx2.createRadialGradient(half, half, 0, half, half, half);
	gradient2.addColorStop(0.025, '#CCC');
	gradient2.addColorStop(0.1, 'hsl(' + hue + ', 61%, 33%)');
	gradient2.addColorStop(0.25, 'hsl(' + hue + ', 64%, 6%)');
	gradient2.addColorStop(1, 'transparent');

	ctx2.fillStyle = gradient2;
	ctx2.beginPath();
	ctx2.arc(half, half, half, 0, Math.PI * 2);
	ctx2.fill();
	var Star = function() {

	  this.orbitRadius = random(maxOrbit(w, h));
	  this.radius = random(60, this.orbitRadius) / 8; 
	  //星星大小
	  this.orbitX = w / 2;
	  this.orbitY = h / 2;
	  this.timePassed = random(0, maxStars);
	  this.speed = random(this.orbitRadius) / 80000; 
	  //星星移动速度
	  this.alpha = random(2, 10) / 10;

	  count++;
	  stars[count] = this;
	}

	Star.prototype.draw = function() {
	  var x = Math.sin(this.timePassed) * this.orbitRadius + this.orbitX,
	    y = Math.cos(this.timePassed) * this.orbitRadius + this.orbitY,
	    twinkle = random(10);

	  if (twinkle === 1 && this.alpha > 0) {
	    this.alpha -= 0.05;
	  } else if (twinkle === 2 && this.alpha < 1) {
	    this.alpha += 0.05;
	  }

	  ctx.globalAlpha = this.alpha;
	  ctx.drawImage(canvas2, x - this.radius / 2, y - this.radius / 2, this.radius, this.radius);
	  this.timePassed += this.speed;
	}

	for (var i = 0; i < maxStars; i++) {
	  new Star();
	}

	function animation() {
	  if(_bgCanvasStop){

	  }else{
	  	  ctx.globalCompositeOperation = 'source-over';
		  ctx.globalAlpha = 1; //尾巴
		  ctx.fillRect(0, 0, w, h);
		  ctx.drawImage(img,0,0, w, h);

		  ctx.globalCompositeOperation = 'lighter';
		  for (var i = 1, l = stars.length; i < l; i++) {
		    stars[i].draw();
		  };
       //window.requestAnimationFrame(animation);
	   window.setTimeout(function(){animation();}, 50);
	  }
	  
	}
    animation(); 
}
function lH1(){
  $(".home, .canvas-bg").fadeIn().css({"opacity":1});
   _runBg('canvas-bg');
}
$(".user-btn").click(function(){
  var _name=$("#user-name").val();
  $(".jie-name").html(_name);
  $(".user").hide();
  $(".jie").fadeIn(500);
  window.setTimeout(function(){
    new html2canvas(document.getElementById('jieBox'),{background:'url(<?php echo $cdnUrl ?>img/jie.jpg)',width:$('#jieBox').width(),height:$('#jieBox').height()}).then(canvas => {
                        //oImg = new Image();
              //oImg.src = canvas.toDataURL("image/png",1.0);
              //$.post("he.php", {pic:canvas.toDataURL()}, function(data){ }, "json");
              $(".p3-press").attr("src" , canvas.toDataURL("image/jpg",1.0));
              window.setTimeout(function(){
                $(".jie-bottom").fadeIn(100);
              }, 20);

                    });

  }, 800);

  $.post("./api/?c=setuser", {name:_name, uid:'<?php echo $uid; ?>', tmu: _userTM, maxid:_maxId }, function(data){}, "json");
 
});


  $(".mus-box").bind('touchstart', function(){
    if(true == _mbgFlag){
      $(".mus").removeClass("gorotate").attr("src","<?php echo $cdnjsUrl ?>img/m4.png");
      _mbgFlag=false;
      _mbg.pause();
      }else{
        $(".mus").addClass("gorotate").attr("src","<?php echo $cdnjsUrl ?>img/m.png");
        _mbgFlag=true;
        _mbg.play();
        
    }
    });
    
    window.setTimeout(function(){
    $.post("api/?c=pv", {op:'<?php echo $uid ?>',ids:'<?php echo $ids; ?>'}, function(data){}, "json");
  }, 700);
      
});
</script>